package homework02;
public class ThreadDemo02  implements  Runnable{
    @Override
    public void run() {
        if (Thread.currentThread().getName().equals("main")){
            for (int i = 1; i < 101; i++) {
                System.out.println(Thread.currentThread().getName() + ":main");
            }
        }else{
            for (int i = 1; i < 51; i++) {
                System.out.println(Thread.currentThread().getName() + ":new");
            }
        }
    }

    public static void main(String[] args) {
        ThreadDemo02 th = new ThreadDemo02();
        Thread t = new Thread(th);
        t.start();
        th.run();
    }
}
